home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Mac Game Programming Gurus
/
TricksOfTheMacGameProgrammingGurus.iso
/
More Source
/
Libraries
/
VideoToolbox 95.04.18
/
VideoToolboxSources
/
SetMouse.c
< prev
next >
Wrap
Text File
|
1994-10-18
|
2KB
|
55 lines
/*
SetMouse.c
Sets the mouse location to the given point, which is specified in the local
coordinate system of the current port.
WARNING: In the Q & A Stack, Apple tells you how to do this, but warns that the
technique uses undocumented low-memory locations that are considered unsupported
and volatile and may change in future CPUs.
WARNING: This may not work as native code on the PowerPC. Then again, it might.
WARNING: According to a note from Apple, this may not work on some newer 680x0 Macs,
e.g. the Centris. They've issued preliminary documentation of a Cursor Device Manager
that eventually will support all Macs. See MoveMouse.c in VideoToolboxSources.
From "Code gadgets: Setting the mouse location", THINKin' CaP, 1(2):28-29, Fall 1990.
Copyright © 1991 SPLAsh Resources. All rights reserved. This source code is
copyrighted, but free. This means that programmers may use the code and
incorporate it into their own programs (commercial or otherwise) without payment
of any fees. However, the source code itself may not be sold or distributed on
electronic bulletin board services without written permission from SPLAsh
Resources.
SPLAsh Resources
1678 Shattuck Ave #302
Berkeley, CA 94709
(415) 527-0122
HISTORY:
2/25/91 dgp added to VideoToolbox
8/24/91 dgp Made compatible with THINK C 5.0.
5/28/94 dgp Eliminated use of SysEqu.h, for compatibility with Apple's Universal Headers.
*/
#include "VideoToolbox.h"
volatile Point MTemp : 0x828; /* Low memory globals */
volatile Point RawMouse : 0x82C;
volatile Byte CrsrNew : 0x8CE;
volatile Byte CrsrCouple : 0x8CF;
void SetMouse(Point where)
{
LocalToGlobal(&where); /* Convert point to global coordinates */
/* Quoting from the Q & A Stack: "If you wish to place the cursor in an */
/* absolute location on the screen, you must set RawMouse, and MTemp to */
/* the same value, and set CrsrNew to the same value as CrsrCouple." */
MTemp=RawMouse=where;
CrsrNew=CrsrCouple;
}